import os
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
from transformers import AutoModel, AutoTokenizer

model_name = "sentence-transformers/all-mpnet-base-v2"
model = AutoModel.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# 保存到本地目录
save_path = r"C:\Users\kimido\.cache\huggingface_Embeddings\models--sentence-transformers--all-mpnet-base-v2"
model.save_pretrained(save_path)
tokenizer.save_pretrained(save_path)